import React from 'react'
import "./style.scss"
import { Tabs } from 'antd-mobile'
import { connect } from 'react-redux'
import actions from "../../store/actions"
const Index=(props:any)=> {

    const {tabType,dispatch}=props
    const tabs=['web前端','前端开发','h5开发','项目主管']
    const changeIndex=(key:any)=>{
        dispatch(actions.changeTabs(key))
    }
    return (
        <div className='head'>
            <div className="headLeft">
            <Tabs activeLineMode='full' onChange={(key:string)=>changeIndex(key)} style={{color:'rgba(255,255,255,.4)'}} activeKey={tabType}>
                {
                    tabs.map((v,i)=>{
                        return(
                            <Tabs.Tab title={v} key={i}>
                            </Tabs.Tab>
                        )
                    })
                }
            </Tabs>
            </div>
            <div className='headRight'>搜索</div>
        </div>
    )
}
const mapStateToProps = (state:any)=>{
    return{
        ...state
    }
}

const mapDispatchToProps =(dispatch:any)=> {
    return{
        dispatch
    }
}
export default connect(mapStateToProps,mapDispatchToProps)(Index)